package com.gitee.tanmingjian.httptunnel.core.bean;

import java.util.Objects;

public class ResultSetHeader {

    private Integer errno;
    private Integer affectRows;
    private Integer insertId;
    private Integer numFields;
    private Integer numRows;

    public ResultSetHeader(Integer errno, Integer affectRows, Integer insertId, Integer numFields, Integer numRows) {
        this.errno = errno;
        this.affectRows = affectRows;
        this.insertId = insertId;
        this.numFields = numFields;
        this.numRows = numRows;
    }

    public Integer getErrno() {
        return errno;
    }

    public void setErrno(Integer errno) {
        this.errno = errno;
    }

    public Integer getAffectRows() {
        return affectRows;
    }

    public void setAffectRows(Integer affectRows) {
        this.affectRows = affectRows;
    }

    public Integer getInsertId() {
        return insertId;
    }

    public void setInsertId(Integer insertId) {
        this.insertId = insertId;
    }

    public Integer getNumFields() {
        return numFields;
    }

    public void setNumFields(Integer numFields) {
        this.numFields = numFields;
    }

    public Integer getNumRows() {
        return numRows;
    }

    public void setNumRows(Integer numRows) {
        this.numRows = numRows;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ResultSetHeader that = (ResultSetHeader) o;
        return Objects.equals(errno, that.errno) && Objects.equals(affectRows, that.affectRows) && Objects.equals(insertId, that.insertId) && Objects.equals(numFields, that.numFields) && Objects.equals(numRows, that.numRows);
    }

    @Override
    public int hashCode() {
        return Objects.hash(errno, affectRows, insertId, numFields, numRows);
    }

    @Override
    public String toString() {
        return "ResultSetHeader{" +
                "errno=" + errno +
                ", affectRows=" + affectRows +
                ", insertId=" + insertId +
                ", numFields=" + numFields +
                ", numRows=" + numRows +
                '}';
    }
}
